#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void turn(int n, char num[])
{
    int i = 1;
    while (n)
    {
        int x = n % 16;
        num[i] = (x < 10 ? x + '0' : x - 10 + 'A');
        n /= 16;
        i--;
    }

}

int main()
{
    int R, G, B;
    scanf("%d%d%d", &R, &G, &B);

    char num1[3] = { '0','0','\0' };
    char num2[3] = { '0','0','\0' };
    char num3[3] = { '0','0','\0' };
    turn(R, num1);
    turn(G, num2);
    turn(B, num3);
    printf("#%s%s%s", num1, num2, num3);
    return 0;
}